package com.xhwl.logistics.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xhwl.common.dto.cent.vehicle.feign.VehicleVisitorCarDTO;
import com.xhwl.common.dto.cent.vehicle.feign.VehicleVisitorCarQuery;
import com.xhwl.common.pojo.cent.vehicle.bo.bi.VehicleAccessRecordTotalStatisticsBO;
import com.xhwl.logistics.bo.input.*;
import com.xhwl.logistics.entity.VehicleAccessRecord;
import com.xhwl.logistics.po.*;
import com.xhwl.logistics.vo.VehicleStatisticsDateVO;
import com.xhwl.logistics.vo.unique.VehicleMNPassageRecordVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
@Repository
public interface IVehicleAccessRecordMapper extends BaseMapper<VehicleAccessRecord> {

    List<VehicleAccessRecordStatisticsDatePO> enterAccessRecordStatistics(QueryVehicleAccessRecordStatisticsBO queryVehicleAccessRecordStatisticsBO);

    List<VehicleAccessRecordStatisticsDatePO> existAccessRecordStatistics(QueryVehicleAccessRecordStatisticsBO queryVehicleAccessRecordStatisticsBO);

    IPage<VehicleAccessRecordPO> queryAccessRecords(@Param("page") IPage<?> page, @Param("queryCondition") QueryVehicleAccessRecordBO queryVehicleAccessRecordBO);
    List<VehicleAccessRecordSecondPO> listAccessRecords(QueryVehicleAccessRecordThirdBO queryVehicleAccessRecordThirdBO);

    List<VehicleAccessRecordPO> queryAccessRecordsByIds(@Param("page") IPage<?> page, @Param("idList") List<Integer> idList);

    IPage<Integer> queryAccessRecordsForPlateNumberDuplicateRemoval(@Param("page") IPage<?> page, @Param("queryCondition") QueryVehicleAccessRecordSecondBO queryVehicleAccessRecordSecondBO);

    Integer accessRecordForCount(QueryVehicleAccessRecordForCountBO queryVehicleAccessRecordForCountBO);

    Integer accessRecordForCountWU(QueryVehicleAccessRecordForCountBO queryVehicleAccessRecordForCountBO);

    List<VehicleCardAccessRecordStatisticsPO> accessRecordForCountSecond(QueryVehicleAccessRecordForCountBO queryVehicleAccessRecordForCountBO);

    List<VehicleLocationAccessRecordStatisticsPO> locationAccessRecordForCount(QueryVehicleAccessRecordForCountBO queryVehicleAccessRecordForCountBO);

    VehicleAccessRecordTotalStatisticsBO getAccessRecordStatistics(@Param("projectId")Integer projectId, @Param("datetime")String datetime);

    List<VehicleStatisticsDateVO> getAccessRecordStatisticsTrend(@Param("projectId")Integer projectId, @Param("range")Integer range, @Param("datetime")String datetime);

    List<VehicleVisitorCarDTO>  getVisitorCarRecordList(@Param("visitorCarQuery") VehicleVisitorCarQuery visitorCarQuery);

    List<VehicleAccessRecord> listAccessRecordByPrjAndThirdParkId(@Param("projectId") Integer projectId, @Param("thirdParkId") String thirdParkId);

    Integer countAccessRecordsToday(@Param("projectId")Integer projectId, @Param("type") Integer type);

    List<VehicleMNPassageRecordVO> listAccessRecordGroupEnter(@Param("projectId") Integer projectId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<VehicleMNPassageRecordVO> listAccessRecordGroupExist(@Param("projectId") Integer projectId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}
